package keeto.com.vn.bms.utils;


import keeto.com.vn.bms.ui.activity.R;
import android.content.Context;
import android.graphics.Bitmap;
import android.widget.ImageView;

import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.assist.ImageScaleType;


public class UniversalImageLoader {
    
	private  ImageLoader imgLoader;
	private  DisplayImageOptions options;
	
    public UniversalImageLoader(Context context){
		options = new DisplayImageOptions.Builder()
		.showImageOnLoading(R.drawable.no_image)
		.showImageForEmptyUri(R.drawable.no_image)
		.showImageOnFail(R.drawable.no_image)
		.imageScaleType(ImageScaleType.IN_SAMPLE_INT)
		.cacheInMemory(true)
		.cacheOnDisc(true)
		.considerExifParams(true)
		.bitmapConfig(Bitmap.Config.RGB_565)
		.build();
		
		imgLoader = ImageLoader.getInstance();
		
    }
    
    public void displayImageView(String url, ImageView img){
    	imgLoader.displayImage(url,img,options);
    }
}
